<?php
/**
 * 资料
 * @author silenus
 *
 */
class m_data extends spModel {
	public $pk = 'data_id';
	public $table = 'data';
	var $linker = array (
			/**
			 * 只有文件是image 文件时才会执行的关联
			 */
			array (
					'type' => 'hasone', // 一对多关联
					'map' => 'album', // 关联的标识
					'mapkey' => 'data_id',
					'fclass' => 'm_pcategory',
					'fkey' => 'pcategory_id',
					'enabled' => true 
			),
			array (),
			
			array () 
	);
	var $verifier = array (
			'rules' => array (
					'type' => array (),
					'name' => array (),
					'source' => array () 
			) 
	);
	/**
	 *
	 * @param array $file        	
	 * @param
	 *        	$link
	 * @return Ambigous <boolean, unknown, mixed>
	 */
	public function el_create_file(array $file, $link_enable = FALSE) {
		$result = $link_enable ? $this->spLinker ()->create ( $file ) : $this->create ( $file );
		return $result;
	}
}
